package com.atguigu.tingshu.order.rpc;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.order.OrderInfo;
import com.atguigu.tingshu.order.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rpc/inner/orderInfo")
public class OrderInfoRpcController {

    @Autowired
    private OrderInfoService orderInfoService;
    @GetMapping("/getOrderInfoByOrderNo/{orderNo}/{userId}")
    Result<OrderInfo> getOrderInfoByOrderNo(@PathVariable(value = "orderNo")  String orderNo, @PathVariable("userId") Long userId){
        OrderInfo orderInfo = orderInfoService.getOrderInfo(orderNo,userId);
        return Result.ok(orderInfo);
    }
}
